package com.moyu.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moyu.admin.entity.SysUserLogin;
import com.moyu.admin.mapper.SysUserMapper;
import com.moyu.admin.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 服务实现类
 *
 * @author moyu
 * @since 2019-02-18
 */
@Service
@Transactional
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserLogin>
    implements SysUserService {

  @Autowired private SysUserMapper sysUserMapper;

  @Override
  public SysUserLogin findByName(String name) {
    QueryWrapper qw = new QueryWrapper();
    qw.eq("username", name);
    return sysUserMapper.selectOne(qw);
  }
}
